package com.example.abe.diandi.trends.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by abe on 17/3/16.
 */

public class TrendModel implements Parcelable {
    public static final int TYPE_TEXT = 1;
    public static final int TYPE_IMAGE = 2;
    public static final int TYPE_IMAGE_TEXT = 3;

    private String id;
    private long time;
    private String title;
    private String content;
    private int type;//动态类型：1.纯文字  2.纯图片  3.文字图片
    private boolean dayFirst;
    private boolean collect;
    private List<ImageTextModel> listImageTextIds;
    private String category_id;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isDayFirst() {
        return dayFirst;
    }

    public void setDayFirst(boolean dayFirst) {
        this.dayFirst = dayFirst;
    }

    public List<ImageTextModel> getListImageTextIds() {
        return listImageTextIds;
    }

    public void setListImageTextIds(List<ImageTextModel> listImageTextIds) {
        this.listImageTextIds = listImageTextIds;
    }

    public boolean isCollect() {
        return collect;
    }

    public void setCollect(boolean collect) {
        this.collect = collect;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getCategory_id() {
        return category_id;
    }

    public void setCategory_id(String category_id) {
        this.category_id = category_id;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeLong(this.time);
        dest.writeString(this.title);
        dest.writeString(this.content);
        dest.writeInt(this.type);
        dest.writeByte(this.dayFirst ? (byte) 1 : (byte) 0);
        dest.writeByte(this.collect ? (byte) 1 : (byte) 0);
        dest.writeTypedList(this.listImageTextIds);
        dest.writeString(this.category_id);
    }

    public TrendModel() {
    }

    protected TrendModel(Parcel in) {
        this.id = in.readString();
        this.time = in.readLong();
        this.title = in.readString();
        this.content = in.readString();
        this.type = in.readInt();
        this.dayFirst = in.readByte() != 0;
        this.collect = in.readByte() != 0;
        this.listImageTextIds = in.createTypedArrayList(ImageTextModel.CREATOR);
        this.category_id = in.readString();
    }

    public static final Creator<TrendModel> CREATOR = new Creator<TrendModel>() {
        @Override
        public TrendModel createFromParcel(Parcel source) {
            return new TrendModel(source);
        }

        @Override
        public TrendModel[] newArray(int size) {
            return new TrendModel[size];
        }
    };
}
